-- summon_telepathize
-- created by zhuangsl
-- 通灵，召唤兽攻击时附加额外伤害,伤害值根据主人属性计算

return {
    apply = function(prop, baseValue)
        return baseValue;
    end,

    -- 攻击触发
    trigger = function(who, prop, arg)
        -- 必须是召唤兽
        if who.type ~= OBJECT_TYPE_SUMMON then
            return;
        end

        -- 玩家的对应属性
        local attrib = prop[2];
        local value = ME.user:queryAttrib(attrib);
        -- 增加的伤害
        local addonDamage = math.modf(prop[3] * value / 1000);

        return math.max(0,addonDamage);
    end,

    record = function(target, prop, path)
        return false;
    end
};
